#pragma once

#ifdef DEBUG

class CDebugHelper
{
public:
    static void InitializeForScene(Ogre::SceneManager* pSceneManager);

    static void DrawPoint(Ogre::Vector3 vectorPoint, float flScale, int nFrames, const Ogre::ColourValue& colour = Ogre::ColourValue::White);
    static void DrawLine(Ogre::Vector3 vectorFrom, Ogre::Vector3 vectorTo, float flScale, int nFrames, const Ogre::ColourValue& colour = Ogre::ColourValue::White);
    static void Update();

    static void PrintDebugString(const char* szFmt, ...);

private:

    class CDebugPoint
    {
    public:
        CDebugPoint(Ogre::SceneManager* pSceneManager);
        ~CDebugPoint();

        void TrackPoint(Ogre::Vector3 vectorPoint, float flScale, int cFrames, const Ogre::ColourValue& color);
        void Update();
        int GetFramesLeft() { return m_cFramesLeft; }

    private:
        Ogre::BillboardSet* m_pBillboardSet;
        Ogre::Billboard*    m_pBillboard;
        Ogre::SceneNode* m_pNode;

        int m_cFramesLeft;
        static int m_sSerialNumber;

    };

    class CDebugLine
    {
    public:
        CDebugLine(Ogre::SceneManager* pSceneManager);
        ~CDebugLine();

        void TrackLine(Ogre::Vector3 vectorFrom, Ogre::Vector3 vectorTo, float flScale, int cFrames, const Ogre::ColourValue& color);
        void Update();
        int GetFramesLeft() { return m_cFramesLeft; }

    private:
        Ogre::BillboardSet* m_pBillboardSet;
        Ogre::Billboard*    m_pBillboard;
        Ogre::SceneNode* m_pNode;

        int m_cFramesLeft;
        static int m_sSerialNumber;

    };


    typedef vector<CDebugPoint*> CDebugPointList;
    static CDebugPointList ms_pointList;

    typedef vector<CDebugLine*> CDebugLineList;
    static CDebugLineList ms_lineList;
    static Ogre::SceneManager* ms_pSceneManager;

};


#endif
